﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Upphoto.aspx.cs" Inherits="Users_Upphoto" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head >
    <%=this.UI_Head(Base_CurrPath, "", "")%>
    <link rel="stylesheet" type="text/css" href="../Css/Users.css" />    
        <script src="../Script/jquery.uploadPreview.js" type="text/javascript"></script>
    <script>
        $(document).ready(function() {
            //建议在#imgDiv的父元素上加个overflow:hidden;的css样式
            $("#FileUpload1").uploadPreview({ width: 107, height: 145, imgDiv: "#ThumbImg", imgType: ["bmp", "gif", "png", "jpg"] });
        });
    
    </script>
    
</head>
<body style="background:#FFFFFF">
    <form id="form1" runat="server">
    <div>
        <table width="100%" cellpadding="0" cellspacing="4" border="0">
                        <tr>
                <td>相片名称:</td><td>
                <asp:TextBox ID="Txt_PhotoName" runat="server" Width="262px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>相片说明:</td><td>
                <asp:TextBox ID="Txt_Readme" runat="server" Height="89px" TextMode="MultiLine" 
                    Width="416px"></asp:TextBox>
                </td>
            </tr>
                         <tr>
                <td>图片地址:</td><td><asp:FileUpload ID="FileUpload1" runat="server" Width="232px" />
                </td>
            </tr>   
            
            <tr>
                <td align="center">&nbsp;&nbsp;&nbsp;缩&nbsp;略&nbsp;图:&nbsp;&nbsp;&nbsp;</td>
                <td> <img src="<%=ThumbImg %>" id="ThumbImg" /></td>
            </tr>
            
            <tr>
                <td colspan="2" align="center"> 
                    <asp:Button ID="Button1" runat="server" Text="立即添加" onclick="Button1_Click" />&nbsp;&nbsp;
                    <asp:Button ID="Button2" runat="server" Text="立&nbsp;即&nbsp;修&nbsp;改" onclick="Button2_Click" Visible="false" />
                </td>
            </tr>   
            
            <tr>
                <td colspan="2" align="center"> 
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="Txt_PhotoName" Display="Dynamic" ErrorMessage="相片名称不能为空"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ControlToValidate="FileUpload1" Display="Dynamic" 
                        ErrorMessage="&lt;br&gt;图片地址不能为空"></asp:RequiredFieldValidator>
                </td>
            </tr>   
        </table>    
    </div>
    </form>
</body>
</html>
